package com.zggk.iroad.log.loglist;

import android.content.Context;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.mikephil.charting.formatter.IFillFormatter;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;
import com.zggk.iroad.api.MyAppliCation;
import com.zggk.iroad.api.Urls;
import com.zggk.iroad.mvp.BasePresenterImpl;

/**
 * MVPPlugin
 * 邮箱 784787081@qq.com
 */

public class LogListPresenter extends BasePresenterImpl<LogListContract.View> implements LogListContract.Presenter {
    @Override
    public void testinfo(String TIME, int PAGEINDEX) {
        String STIME1 = "";
        STIME1 = TIME.replace("年", "-");
        STIME1 = STIME1.replace("月", "");
        OkGo.<String>get(Urls.YNIP + "QueryRzListByTime")
                .params("gydwid", MyAppliCation.spUtils.getString("GydwId"))
                .params("time", STIME1)
                .params("orderby", "")
                .params("pageIndex", PAGEINDEX)
                .params("pageSize", "25")
                .execute(new StringCallback() {
                    @Override
                    public void onSuccess(Response<String> response) {
                        LogListbean videoVos2 = JSON.parseObject(response.body(), LogListbean.class);
                        if (videoVos2.getState().equals("1")) {
                            mView.getData(videoVos2);
                        }

                    }
                });

    }
}
